home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / ctb100t / ctb.h < prev    next >
Text File  |  1987-08-28  |  2KB  |  81 lines

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *                             ctb.h                                       *
  4.  *                                                                         *
  5.  *      The C Tool Box library header for version 1.0                      *
  6.  *                                                                         *
  7.  ***************************************************************************/
  8.  
  9.  
  10. struct tvector { unsigned int offset, segment; };
  11. #define TVECTOR tvector
  12.  
  13. struct tregx { unsigned int ax,bx,cx,dx,si,di,ds,es,flags; };
  14. struct tregh { unsigned int al, ah, bl, bh, cl, ch, dl, dh; };
  15.  
  16. union treg { struct tregx x; struct tregh h; };
  17.  
  18.  
  19.  /*  alias data types  */
  20.  
  21. #define UCHAR   unsigned char
  22. #define UINT    unsigned int
  23. #define ULONG   unsigned long
  24. #define USHORT  unsigned short
  25.  
  26. /*  Boolean data type  */
  27.  
  28. typedef enum
  29. {
  30.    FALSE, TRUE
  31. } BOOLEAN;
  32.  
  33. /* Return values and exit codes */
  34.  
  35. #define OK       0
  36. #define BAD      1
  37. #define SUCCESS  0
  38. #define FAILURE  1
  39.  
  40. /*  infinite loop declaration */
  41.  
  42. #define FOREVER   1
  43.  
  44. /* masks */
  45.  
  46. #define HIBYTE    0xff00
  47. #define LOBYTE    0x00ff
  48. #define HI_NIBBLE 0x0f
  49. #define LO_NIBBLE 0xf0
  50. #define ASCII     0x7f
  51. #define HIBIT     0x80
  52.  
  53. /* data lengths */
  54.  
  55. #define MAXNAME  8è#define MAXEXT   3
  56. #define MAXLINE  256
  57. #define MAXPATH  64
  58.  
  59. /* special values */
  60.  
  61. #define BIGGEST  65535
  62.  
  63.  
  64. /*  macro Unit conversions */
  65.  
  66. #define INCH_CM(x)        ((x)*2.54)
  67. #define CM_INCH(x)        ((x)*0.3937008)
  68. #define DEG_RAD(x)        ((x)*0.017453293)
  69. #define RAD_DEG(x)        ((x)*57.29577951)
  70. #define OZ_GM(x)          ((x)*28.349523)
  71. #define GM_OZ(x)          ((x)*0.035274)
  72. #define GAL_LT(x)         ((x)*3.78541)
  73. #define LT_GAL(x)         ((x)*0.2642722)
  74. #define LB_KG(x)          ((x)*0.45359237)
  75. #define KG_LB(x)          ((x)*2.20462262)
  76. #define MI_KM(x)          ((x)*1.609344)
  77. #define KM_MI(x)          ((x)*.6213712)
  78. #define M_YD(x)           ((x)*.9144)
  79. #define YD_M(x)           ((x)*1.094)
  80.  
  81.